package cn.cnf.common.enums;

/**
 * @author ZhuMeiYi
 * @date 2021/2/13 9:58
 * @description
 */
public enum RecommendState {

    /**
     * 推荐和不推荐
     */
    RECOMMEND("推荐",1),
    NOT_RECOMMEND("不推荐",0);
    /**
     * 类型
     */
    private String state;
    /**
     * 值
     */
    private Integer value;

    RecommendState(String state, Integer value) {
        this.state = state;
        this.value = value;
    }

    public static RecommendState getByValue(Integer value) {
        for (RecommendState recommendType : values()) {
            if (recommendType.getValue().equals(value)) {
                return recommendType;
            }
        }
        return null;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }
}
